using System;
using System.Collections.Generic;


namespace ProductInfo.Core.Service
{
	public class ValidationErrorCollection : IValidationErrorCollection
	{
		public IDictionary<string, string> Errors { get; private set; }


		public bool IsValid { get { return (!(this.Errors.Count > 0)); } }


		public ValidationErrorCollection()
		{
			this.Errors = new Dictionary<string, string>();
		}


		public void AddError(
			string key, 
			string errorMessage)
		{
			this.Errors.Add(key, errorMessage);
		}


	}
}